package com.ruoyi.eval.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.eval.mapper.EvalQuestionOptionMapper;
import com.ruoyi.eval.domain.EvalQuestionOption;
import com.ruoyi.eval.service.IEvalQuestionOptionService;

/**
 * 题目选项Service业务层处理
 * 
 * @author yepanpan
 * @date 2025-05-06
 */
@Service
public class EvalQuestionOptionServiceImpl implements IEvalQuestionOptionService 
{
    private static final Logger log = LoggerFactory.getLogger(EvalQuestionOptionServiceImpl.class);

    @Autowired
    private EvalQuestionOptionMapper evalQuestionOptionMapper;

    /**
     * 查询题目选项
     * 
     * @param id 题目选项主键
     * @return 题目选项
     */
    @Override
    public EvalQuestionOption selectEvalQuestionOptionById(Long id)
    {
        return evalQuestionOptionMapper.selectEvalQuestionOptionById(id);
    }

    /**
     * 查询题目选项列表
     * 
     * @param evalQuestionOption 题目选项
     * @return 题目选项
     */
    @Override
    public List<EvalQuestionOption> selectEvalQuestionOptionList(EvalQuestionOption evalQuestionOption)
    {
        return evalQuestionOptionMapper.selectEvalQuestionOptionList(evalQuestionOption);
    }

    /**
     * 新增题目选项
     * 
     * @param evalQuestionOption 题目选项
     * @return 结果
     */
    @Override
    public int insertEvalQuestionOption(EvalQuestionOption evalQuestionOption)
    {
        evalQuestionOption.setCreateTime(DateUtils.getNowDate());
        return evalQuestionOptionMapper.insertEvalQuestionOption(evalQuestionOption);
    }

    /**
     * 修改题目选项
     * 
     * @param evalQuestionOption 题目选项
     * @return 结果
     */
    @Override
    public int updateEvalQuestionOption(EvalQuestionOption evalQuestionOption)
    {
        evalQuestionOption.setUpdateTime(DateUtils.getNowDate());
        return evalQuestionOptionMapper.updateEvalQuestionOption(evalQuestionOption);
    }

    /**
     * 批量删除题目选项
     * 
     * @param ids 需要删除的题目选项主键
     * @return 结果
     */
    @Override
    public int deleteEvalQuestionOptionByIds(Long[] ids)
    {
        return evalQuestionOptionMapper.deleteEvalQuestionOptionByIds(ids);
    }

    /**
     * 删除题目选项信息
     * 
     * @param id 题目选项主键
     * @return 结果
     */
    @Override
    public int deleteEvalQuestionOptionById(Long id)
    {
        return evalQuestionOptionMapper.deleteEvalQuestionOptionById(id);
    }


}
